import com.jzy.dao.OrderDao;
import com.jzy.utils.DateUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.Date;
import java.util.Map;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"classpath:spring-configs/applicationContext.xml"})
public class test1 {

    @Autowired
    private OrderDao orderDao;

    @Test
    public void demo1() throws Exception {
        Map map = orderDao.findById4Detail(17);
        if(map != null){
            //处理日期格式
            Date orderDate = (Date) map.get("orderDate");
            map.put("orderDate", DateUtils.parseDate2String(orderDate));
        }
        System.out.println(map);
    }
}
